<template class="container">
    <WindowTitleBar title="测试"></WindowTitleBar>
    <button onclick=Add>Add</button>
    <button onclick=Sub>Sub</button>
    <button onclick=Replace>Replace</button>
    <div v-for="item, index in List">item = {{item}} index = {{index}}</div>
    <div v-if="#List == 0">EmptyList</div>
    <div v-if="#List ~= 0">NoEmptyList</div>

    <div v-for="x in ObjectList">
        <input v-bind:value="x.order" onblur=ClickUpdate></input>
    </div>
    <div onclick="ClickUpdate">test</div>
</template>

<script type="text/lua">
RegisterComponent("WindowTitleBar", "%vue%/Components/WindowTitleBar.html");

Prefix = "List Item ";
List = {};

ObjectList = {{order =1}, {order = 2}};
local index = 1;
function ClickUpdate()
    if (index  == 1) then ObjectList = {{order =3}, {order = 4}} end
    if (index  == 2) then ObjectList = {{order =5}, {order = 6}} end
    if (index  >= 3) then ObjectList = {{order =index}, {order = 8}} end
    index = index + 1;
end

function Add()
    table.insert(List, Prefix .. tostring(#List + 1)); 
end 

function Sub()
    table.remove(List, #List);
end

function Replace()
    List = {}
end

function OnReady()
end

</script>

<style>
.container {
    height: 100%; 
    width: 100%; 
    padding: 0px 2px 2px 2px;
    /* border: 1px solid #ffffff; */
    background: url(Texture/Aries/Creator/keepwork/Window/dakuang_32bits.png#0 0 440 93:378 43 33 44);
}
</style>
